package top.yaofengqiao.springcloudsimple.system.biz.trigger.dubbo;

import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;
import top.yaofengqiao.springcloudsimple.system.api.IUserDubboService;
import top.yaofengqiao.springcloudsimple.system.api.dto.UserDTO;

/**
 * @author yfq
 * @date 2024/5/25 14:19
 * @description
 */
@DubboService
public class UserDubboService implements IUserDubboService {

    @Override
    public UserDTO getByUserId(Long userId) {
        return new UserDTO(userId, "yfq");
    }

    @Override
    public String getUsername() {
        RpcContext.getContext().setAttachment("username", "yfq");
        return "...";
    }

}
